<?php
defined('IN_TS') or die('Access Denied.');
/* 
 * 小组话题编辑
 */

$topicid = intval($_GET['topicid']);

$userid = $TS_USER['user']['userid'];

$strTopic = $DB->once_fetch_assoc("select * from ".dbprefix."app_group_topics where topicid='".$topicid."'");

$strGroup = $DB->once_fetch_assoc("select * from ".dbprefix."app_group where groupid='".$strTopic['groupid']."'");

$strGroupUser = $DB->once_fetch_assoc("select * from ".dbprefix."app_group_users where userid='$userid' and groupid='".$strTopic['groupid']."'");

if($userid != $strTopic['userid'] && $userid!=$strGroup['userid'] && $strGroupUser['isadmin']=='0'){
	qiMsg("机房重地，闲人免进！");
}

//帖子类型
$arrGroupType = $DB->fetch_all_assoc("select * from ".dbprefix."app_group_topics_type where groupid='".$strGroup['groupid']."'");

$title = '编辑帖子';

include TmooTemplate("topic_edit");